import { Define, EntityObjectFactory } from 'tiny-entity2';
const EntityObjectType = EntityObjectFactory.GetEntityObjectType(process.env.dataBaseType || 'mysql');

@Define.Table({ TableName: "promotionitem" })
export class PromotionItem extends EntityObjectType<PromotionItem>{
    @Define.PrimaryKey()
    id: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    name: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        NotAllowNULL: true
    })
    promotionId: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        NotAllowNULL: true
    })
    mode: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    productId: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    productName: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    categoryId: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    categoryName: string;

    @Define.Column({
        DataType: Define.DataType.BOOL,
        NotAllowNULL: true
    })
    isInclude: boolean;

    @Define.Column({
        DataType: Define.DataType.Decimal,
        DataLength: 10,
        DecimalPoint: 3
    })
    value: number;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        IsIndex: true,
        NotAllowNULL: true
    })
    storeId: string;

    
    @Define.Column({
        DataType: Define.DataType.BIGINT
    })
    createTime: number;

    @Define.Column({
        DataType: Define.DataType.BIGINT
    })
    version: number;
}